<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" 
      xmlns:sec="http://www.pollix.at/thymeleaf/shiro">
<head th:replace="admin/common/html/head :: head_Normal(~{::title},~{::link},~{::style})">

<title th:text=${title}></title>
<!-- 这儿引用单独的css link -->
<!-- Ladda for Bootstrap 3按钮加载进度插件 -->
<link rel="stylesheet" th:href="@{/static/admin/assets/js/button/ladda/ladda.min.css}">
<!-- bootstrap-table表单样式 -->
<link th:href="@{/static/admin/assets/js/bootstrap/css/bootstrap-table/bootstrap-table.min.css}" rel="stylesheet"/>

<style type="text/css">
/**
*这里写单独的css样式
*/
.select-list ul li{
	list-style-type: none;
	float: left;
}
</style>

</head>

<body id="listbody">
<!-- ###############################代码编写处############################### -->
<!-- 右边内容 -->
<div class="wrap-fluid">
    <div class="container-fluid paper-wrap bevel tlbr">
        <!-- 内容 -->
        <!--标题 通用-->
        <!--<div th:replace="admin/common/html/title :: title(${title},${parenttitle},${isMsg},${msgHTML})">
        </div>-->
        <!-- 结束标题 通用-->
        <div class="content-wrap">
            <!-- 结束内容 -->
            <div class="row">
                <div class="col-sm-12">
                    <!-- 空白页开始-->
                    <div class="nest" id="Blank_PageClose">
                        <div class="body-nest" id="Blank_Page_Content">
                            <table id="dataTable" class="table-striped footable-res footable metro-blue" data-page-size="6">
                            </table>
                        </div>
                    </div>
                </div>
                <!-- 空白页结束 -->
            </div>
            <!-- 结束内容 -->
        </div>
    </div>
</div>
<!-- 结束右边内容 -->
<!-- ###############################代码编写处############################### -->
<!-- 通用js -->
<div th:include="admin/common/html/js :: onload_js">
   
</div>
<!-- bootstarp 表格 -->
<script th:src="@{/static/admin/assets/js/bootstrap/js/bootstrap-table/bootstrap-table.min.js}" type="text/javascript"></script>
<script th:src="@{/static/admin/assets/js/bootstrap/js/bootstrap-table/locale/bootstrap-table-zh-CN.min.js}" type="text/javascript"></script>
<script th:src="@{/static/admin/assets/js/bootstrap/js/base_list.js}" type="text/javascript"></script>
<!-- 导出 -->
<!--<script th:src="@{/static/admin/assets/js/bootstrap/extensions/export/bootstrap-table-export.js}" type="text/javascript"></script>
<script th:src="@{/static/admin/assets/js/bootstrap/extensions/export/tableExport.js}" type="text/javascript"></script>-->

<!-- 弹窗 -->
<script th:src="@{/static/admin/assets/js/layer/layer.js}" type="text/javascript"></script>
<!-- 遮罩层 -->
<script th:src="@{/static/admin/assets/js/blockUI/jquery.blockUI.js}" type="text/javascript"></script>

<script type="text/javascript">
<!-- jquery-export 表格导出插件 -->

<!-- 导出 -->
var processDefinitionId="[[${processDefinitionId}]]";
var dataUrl=window.rootPath+"/act/flowElementsList?processDefinitionId="+processDefinitionId;
var removeUrl=window.rootPath+"/UserController/remove";
var createUrl=window.rootPath+"/UserController/add";
var updateUrl=window.rootPath+"/UserController/edit/{id}";
var exportUrl=window.rootPath+"/UserController/export";
  var options = {
		dataUrl: dataUrl,
        createUrl: createUrl,
        updateUrl: updateUrl,
        removeUrl:removeUrl,
        exportUrl: exportUrl,
        sortName: "roleSort",
        modalName: "流程",
        search: false,
	   dataColumns: [
           {
               field: 'id',
               title: 'id'
           },
           {
               field: 'name',
               title: '名称'
           },
			{
			    field: 'elementClass',
			    title: '类型',
			},
           {
               field: 'elementClassDescript',
               title: '类型说明'
           },
           {
               title: '操作',
               formatter: function (value, row, index) {
                   var id = row.id;
                   var actions = [];
                   actions.push('<a class="btn btn-success btn-xs"  href="#" onclick="goUpdateFlowElements(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑节点</a> ');
                   return actions.join('');
			    }
			}]
  };
$(function(){
	var oTab=$.table.oTableInit(options);
	oTab.Init();
})
</script>


<script type="text/javascript">
	var editPwdUrl=window.rootPath+"/UserController/editPwd/{id}";
	function updatePwd(){
		 var rows = $.common.isEmpty($.table._option.id) ? $.table.selectFirstColumns() : $.table.selectColumns($.table._option.id);
        if (rows.length == 0) {
            $.modal.alertWarning("请至少选择一条记录");
            return
        }else if(rows.length>1){
            $.modal.alertWarning("请选择一条记录");
            return
        }
         
        
         var url = editPwdUrl.replace("{id}", rows.join());
         var data = {
             "id":rows.join()
         };
		 $.modal.open("修改密码", url);
	}
	function goAdd(){
	    $.get("/models/newModel",{},function(data){
            window.open("/static/activiti-webapp/modeler.html?modelId="+data.modelId);
        });
    }

    function changeProcessDefinitionSuspendStatus(pdId,isSuspended){
	    var message="您确定要激活该流程定义吗？";
	    if(!isSuspended){
            message="您确定要挂起该流程定义吗？";
        }

        $.modal.confirm(message, function() {
            var url = "/act/changeProcessDefinitionSuspendStatus"
            var data = {
                "processDefinitionId":pdId
            };
            $.operate.submit(url, "post", "json", data);
        })
    }

    function viewProcessImage(processDefinitionId){
        var index=layer.open({
            area: ['600px', '450px'],
            maxmin: true,
            type: 2,
            content: '/act/preProcessImage?processDefinitionId='+processDefinitionId //这里content是一个URL，如果你不想让iframe出现滚动条，你还可以content: ['http://sentsin.com', 'no']
        });
        layer.full(index);
    }

    function goUpdateProcess(modelId){
        window.open("/static/activiti-webapp/modeler.html?modelId="+modelId);
    }

    function showElementList(processDefinitionId){
        var index=layer.open({
            area: ['600px', '450px'],
            maxmin: true,
            type: 2,
            content: '/act/view?processDefinitionId='+processDefinitionId //这里content是一个URL，如果你不想让iframe出现滚动条，你还可以content: ['http://sentsin.com', 'no']
        });
    }

</script>



</body>


</html>
